package com.smileymedia.smil.content;

import java.util.HashMap;
import java.util.Map;

import android.graphics.Canvas;

/**
 * 
 * @author gbugaj
 *
 */
public abstract class SmilContent {
	
	public boolean isDowloadable;
	public  Map<String, String> mParameters =  new HashMap<String, String>();
	
	public boolean isDowloadable() {
		return isDowloadable;
	}


	public void setDowloadable(boolean isDowloadable) {
		this.isDowloadable = isDowloadable;
	}


	public String localData;
	public String getLocalData() {
		return localData;
	}

	public void setLocalData(String localData) {
		this.localData = localData;
	}
	

	/**
	 * Content of the component
	 */
	public String source;

	
	/**
	 * Get the source of given element, in case of SmilText it will return the
	 * inner content of the node representing the text
	 * @return
	 */
	public  String getSource(){
		return source;
	}
	

	public void setSource(String source) {
		this.source=source;		
	}
	
	/**
	 * Get the region that is accociated with this content
	 * 
	 * @return region or null if no content have been specified
	 */
	public abstract SmilRegion getRegion();
	
	/**
	 *  
	 <text src = "data:,3)%20transitions."
            region = "rgn3">
        <param name = "fontFace" value = "comic sans ms" />
        <param name = "fontSize" value = "5" />
        <param name = "hAlign" value = "center" />
        <param name = "vAlign" value = "center" />
        <param name = "fontColor" value = "blue" />
        <param name = "backgroundColor" value ="yellow" />
      </text>
	 * @return
	 */
	public  Map<String, String> getParameters(){
		return mParameters;
	}
	
	
	public void setParameters(Map<String, String> parameters){
		this.mParameters=parameters;
	}
	
	
	public abstract void render(Canvas canvas);
	
	/**
	 * Serializes given component to xml
	 */
	public abstract String toXML();

}
